Kefu = function(id, _top, _left) {
    var me = id.charAt ? document.getElementById(id) : id,
    d1 = document.body,
    d2 = document.documentElement;
    d1.style.height = d2.style.height = '100%';
    me.style.top = _top ? _top + 'px': 0;
    me.style.left = _left + "px";
    me.style.position = 'absolute';
    setInterval(function() {
        me.style.top = parseInt(me.style.top) + (Math.max(d1.scrollTop, d2.scrollTop) + _top - parseInt(me.style.top)) * 0.1 + 'px'
    },
    10 + parseInt(Math.random() * 20));
	if (wWidth > 1000) {               //最后显示
		$("#qq_Kefu").show();
		$("#my_order").show();
	}else{
		$("#qq_Kefu").hide();
		$("#my_order").hide();
	}
    return arguments.callee
};
window.onload = function() {
	var wLeft=$("#qq_Kefu").width();       /*距离左侧广度*/
	var oLeft=-$("#my_order").width();
	wWidth = $(window).width();
	if (wWidth > 960) {
		wLeft = Math.ceil((wWidth - wLeft));
		oLeft = Math.ceil((wWidth - 1000) / 2)-27;
	}
    Kefu('qq_Kefu', 175, wLeft);
	Kefu('my_order', 200, oLeft)
};
lastScrollY = 0;
var InterTime = 1;
var maxWidth = -1;
var minWidth = 27;  
var numInter = 16;
var BigInter;
var SmallInter;
var o = document.getElementById("qq_Kefu");
var i = parseInt(o.style.left);
function Big() {
    if (parseInt(o.style.left) < maxWidth) {
        i = parseInt(o.style.left);
        i += numInter;
        o.style.left = i + "px";
        if (i == maxWidth) clearInterval(BigInter)
    }
};
function toBig() {
    clearInterval(SmallInter);
    clearInterval(BigInter);
    BigInter = setInterval(Big, InterTime);
    $(".kfbut").hide();
};
function Small() {
    if (parseInt(o.style.left) > minWidth) {
        i = parseInt(o.style.left);
        i -= numInter;
        o.style.left = i + "px";
        if (i == minWidth) clearInterval(SmallInter)
    }
};
function toSmall() {
    clearInterval(SmallInter);
    clearInterval(BigInter);
    SmallInter = setInterval(Small, InterTime);
    $(".kfbut").show();
}
toBig();